package com.project.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.project.bean.LogBean;
import com.project.service.ILogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;

@RestController
@RequestMapping("log")
@Api(tags = "日志控制器")
public class LogController {
    @Autowired
    private ILogService service;

    @RequiresPermissions("log:*")
    @RequestMapping("cutByItem")
    @ApiOperation(value = "日志分页", notes = "日志分页")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "pageNO", value = "页码", required = true),
            @ApiImplicitParam(name = "startDate", value = "日志起始日期"),
            @ApiImplicitParam(name = "endDate", value = "日志结束日期")
    })
    public IPage<LogBean> cutByItem(Integer pageNO, LocalDate startDate, LocalDate endDate) {
        return service.cutByItem(pageNO, startDate, endDate);
    }
}
